#ifndef __STEGIO_H__
#define __STEGIO_H__ 1

#include "types.h"

namespace NStegIO
{
	enum EReadState
	{
		READ_STATE_ERROR = 0,
		READ_STATE_EOF,
		READ_STATE_DATA,
		READ_STATE_NODATA,
	};
};

/**
 * @brief abstraction layer of a steg payload data source and sink
 * @author gpitsch and rpoisel
 */
class IStegIO
{
public:
	virtual ~IStegIO() { }

	virtual bool open() = 0;
	virtual void close() = 0;
	virtual NStegIO::EReadState read(unsigned char& pByte) = 0;
	virtual void write(unsigned char pByte) = 0;

	/**
	 * @brief get size of available bytes which can be read with the read methode.
	 * For example: If this methode return 19 then the read methode can be called
	 * 19 times without an EOF.
	 *
	 * This methode is necessary for CFrameBuilder. Not for CByteBuilder.
	 * @return Count of available bytes for read.
	 *         0 for currently no available bytes.
	 *         -1 for an error or if this methode is not supported.
	 */
	virtual int available() = 0;
};

#endif // __STEGIO_H__

